If you're using an Ultimarc Pac-Drive, check out this:

https://retropie.org.uk/forum/topic/4126/howto-led-control-with-a-pac-drive